<html>
<head>
<title>Next-generation autotools</title>
</head>
<style>
dt { padding-top: 0.7em; }
dd { padding-top: 0.2em; }
</style>
<body>

<h1>Next-generation Autotools</h1>

The "next-generation autotools" project (NGAT) is an effort to replace the current combination of GNU Autoconf, Automake, and Libtool with a faster, simpler, and more modern tool. 

<h2>Rationale</h2>

GNU autotools are bloated, complex, filled with historical cruft, and painfully slow to use. They clutter up your project with a bunch of generated files. Not everyone wants to learn macro programming in M4 just to be able to build a C program.

<h2>Supported makefile targets</h2>

NGAT provides the following Makefile targets:

<table border=1>
<tr><th>Target<th>Description</tr>
<tr><td>all<td>Build all binaries and libraries</tr>
<tr><td>check<td>Build and execute the test suite</tr>
<tr><td>dist<td>Create a compressed tarball of all source code and data</tr>
<tr><td>install<td>Install files to the filesystem</tr>
<tr><td>uninstall<td>Uninstall all program files, libraries and documentation. Does not delete any data or configuration files.</tr>
<tr><td>purge<td>Uninstall and delete everything including data and configuration files.</tr>
<tr><td>clean<td>Remove all generated object files (*.o)</tr>
<tr><td>distclean<td>Remove all generated object code and temporary files</tr>
</table>

<h2>Supported Platforms</h2>

NGAT is composed of two parts: a Bourne shell script, and a Makefile. It should work on any POSIX platform that has make(1) and sh(1). Both GNU make and BSD make is supported. It has been tested on OpenBSD, MacOS X, and Linux. It does not support building projects on Microsoft&reg; Windows&reg;, unless you use Cygwin to provide a complete POSIX environment.

<h2>Download</h2>

The source code is available from the Subversion repository and may be downloaded using the following command:

<pre>
svn checkout http://ngat.googlecode.com/svn/trunk/ ngat-read-only
</pre>

<h2>Usage</h2>

The following steps show how to use NGAT to build a project.
<ol>
<li>Download and install NGAT
<li>If your project already has a Makefile, move it out of the way.
<li>Run <em>newproject</em> in the top-level project directory. This will generate the <em>config.mk</em> and <em>configure</em> files.
<li>Edit the generated <em>Makefile</em> to suit your needs.
</ol>

<h2>Configuration</h2>

<h3>configure.in</h3>

<h4>Variables</h4>

A couple of variables must be defined within configure.in:

<p>
<dt>PACKAGE</dt>
<dd>The package name of the project.</dd>

<dt>VERSION</dt>
<dd>The version number of the project</dd>

<dt>CREATE_DIRS</dt>
<dd>A list of directories to be created by the "make install" target. A typical value might include PKGDATADIR and it's subdirectories. This directory, and everything in it, will be deleted during "make purge" but will not be removed after a "make uninstall".</dd>

<h4>Functions</h4>

There are some predefined Bourne shell functions that can be used in configure.in. Feel free to create your own functions; the configure.in file is sourced by configure every time the './configure' command is issued.
<p>

<dt>check_symbol()</dt>
<dd>Tests for the availability of a symbol in the system's C library
</dd>

<dt>check_header()</dt>
<dd>Tests for the existence of a header file
in the /usr/include directory.
</dd>

<h3>Compatibility</h3>

NGAT tries to use the same terminology and syntax as Automake.
However, there are currently a few incompatibilies:
<p>
<ul>
<li>Automake supports a generic man_MANS variable as well as individual
man1_MANS, man2_MANS, man3_MANS, etc. NGAT only supports man_MANS.
<li>GNU hates manpages, so Automake doesn't include them in "make dist" by default. NGAT assumes that manpages are real, and does include them in "make dist". so use man_MANS instead of dist_man_MANS
<li>Use CFLAGS to store default compiler flags, not AM_CFLAGS
<li>Automake defines the variable HAVE_CONFIG_H when compiling; NGAT does not support this variable
</ul>

In addition, as an extension, NGAT requires the use of the 'SOURCES' variable. The SOURCES variable should list all source code files in the project. 

<h3>Bugs</h3>

<ul>
<li>The SUBDIRS variable is only supported when running 'make build' and not for other compilation targets. 
</ul>

<h3>Variables</h3>
<p>
The following variables are required:<p>
<ul>
<li>PACKAGE</li>
<li>VERSION</li>
<li>SOURCES</li>
</ul>

The following global variables are valid when building C objects from source:<p>
<ul>
<li>CC</li>
<li>CFLAGS</li>
<li>LDADD</li>
</ul>

Supported Automake variables are:
<p>

<dt>EXTRA_DIST</dt><dd>Extra files to be included in the source distribution</dd>
<dt>SUBDIRS</dt><dd>Subdirectories to descend into (but see Compatibility)</dd>
<dt>lib_LIBRARIES</dt><dd>Libraries to be created</dd>
<dt>bin_PROGRAMS</dt><dd>Programs to be installed under BINDIR</dd>
<dt>sbin_PROGRAMS</dt><dd>Programs to be installed under SBINDIR</dd>
<dt>check_PROGRAMS</dt><dd>Programs to be run during `make check'</dd>
<dt>include_HEADERS</dt><dd>Headers to to be installed under INCLUDEDIR</dd>
<dt>data_DATA</dt><dd>Data files to be installed under DATADIR</dd>
<dt>pkgdata_DATA</dt><dd>Data files to be installed under PKGDATADIR</dd>

<h2>Links</h2>

<a href="http://pmk.sourceforge.net/">Pre Make Kit</a>
.. autoconf, automake

<h2>License</h2>
<pre>
Copyright (c) 2007 Mark Heily &lt;devel@heily.com&gt;

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
 
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
</pre>
<hr>
<center>
<pre>
$Id: index.html 33 2008-09-24 03:05:21Z mheily $
</pre>
</center>
</body>
</html>

